-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Basic Youtube Embed feature + Word Counter #383
Conversation
@MODSetter is attempting to deploy a commit to the Dub Team on Vercel. A member of the Team first needs to authorize it. |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/typescript@5.4.5 |
TypeError: editor.chain(...).focus(...).deleteRange(...).setYoutubeVideo is not a function |
Do Build of headless package first |
what if i dont want to wait and include headless package in my project, I have tried to add youtube directly from tiptap, but it failed to run the command. the command from tiptap for youtube is like "editor.commands.setYoutubeVideo({ |
I tried with direct configuration before to test the impl then made the final changes in package. You must be not configuring it properly. See tiptap docs it helped me. Make sure you are loading youtube extension in editor. |
did you mean you tried with direct implementation and it worked? If so how different you configured it by directly implementing |
On Mobile so I don't remember every file name but I think you load ,configure and export in extension.ts and it should work. |
I build another selector to add the youtube video , and it words, but I don't know if I can get the slash-command right though. I will try again. happy to share the youtube-selector here : `import { useEffect, useRef } from "react" import { cn, isValidUrl, isValidYoutubeUrl } from "@/lib/utils" interface YoutubeSelectorProps { function getYoutubeUrlFromString(str: string) { export const YoutubeSelector = ({ // Autofocus on input by default if (!editor) return null const addYoutubeVideo = () => {
} return ( ↗ <p className={cn("underline decoration-stone-400 underline-offset-4")} > Youtube Embed Video ) } ` Hey thanks man @MODSetter |
I have same problem with slash-comand can't seem to find a way to render BubbleMenu to call a Embed or Upload(Blob Api) Dialog like Notion. Will probably take a look at the code next week 😬 |
Recording.2024-04-27.211125.mp4I got both the selector and the slash command working, but I can't fix the position problem of the popover triggered by the slash command lol. I can manually overwrite the position though but I just want the popover to be where we trigger the slash command of youtube |
What was the workaround around slash? |
basically, the main idea is to trigger the youtube selector by using slash since we have configured the youtube selector to work as expected, I couldn't use editor.chain(...).focus(...).deleteRange(...).setYoutubeVideo in the slash due to the ts errors say it is not a function, and I think we shouldn't directly use slash to setYoutubeVideo, because it seems too complicated to implement all the UI it needed in the slash such as toast or a popover (or modal, I used modal cuz I couldn't configure the popover to be right position of the slash) |
Merge Conflicts with recent merges to main. Will raise PR after resolving them. |
The Wordcounter does not work as expected when there are two or more active instances of editor. |
Can't understand.... main webapp(novel.sh) is using 2 instances one in dialog and it works fine. |
You are right. I can't understand why its not the case on my app. After debugging I found out that using Here is test deployment: https://deploy-preview-2--noteeasy.netlify.app/ The two instances are Note : If you want to use the test app, you should signup using registration form as using login with google will redirect you to production url which we don't want. |
Use this editor component: https://github.com/steven-tey/novel/tree/main/apps%2Fweb%2Fcomponents%2Ftailwind It have latest update implementation |
Would using this solve the issue? |
Added basic Youtube Embed Feature + Word Counter
Demo:
ytwordcounter.mp4